#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int n,m,l,v,a[3005],b[3005],t,c[3005],k[3005],manage[3005];
int main()
{
    freopen("detect.in","r",stdin);
    freopen("detect.out","w",stdout);
    cin>>t;
    for(int i=1;i<=t;i++)
    {
        cin>>n>>m>>l>>v;
        cout<<0<<' '<<m<<endl;
    }

    fclose(stdin);
    fclose(stdout);
    return 0;
}
